<%@page import="com.dts.project.dao.ProductDetailsDao"%>
<%@page import="com.yourcompany.struts.form.ProductDetailsForm"%>
<%@page import="com.dts.project.dao.ProductMasterDao"%>
<%@page import="com.dts.core.util.CoreList"%>
<%@page import="java.util.Enumeration"%>
<%@page import="com.yourcompany.struts.form.ProductMasterForm"%>
<%@page import="com.dts.project.dao.CountryMasterDao"%>
<%@page import="com.yourcompany.struts.form.CountryMasterForm"%> 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/transitional.dtd">
<html>
<head>
<style>
body,td,th {
	color: #B00606;
	font-family: Verdana, Arial, Helvetica, sans-serif;
}
.style9 {color: #FFFFFF}
body {
	background-color: #003333;
}
</style>

<title>EPost- Office</title>
<script type="text/javascript" src="scripts/moveclock.js"></script>



<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /></head>
<body>
<table width="750" align="center" bgcolor="#B00606">
<tr><td>
<img src="images/epostoffice.gif" width="780"></td>
</tr>
<tr>
   <td bgcolor="#E16A00">
   <jsp:include page="Adminoptions.jsp"/>
   </td></tr>
<tr><td>
<%--<div align="center">--%>
<%--<table bgcolor="#B00606" width="750" align="center">--%>
<%--<tr>--%>
<%--   <td><jsp:include page="Template.html"/></td></tr></table></div>--%>
<div align="center">
<table bgcolor="#B00606" width="770" align="center" height="70">
<tr>
   <td>
   
   
     <p>&nbsp;</p>
     <p>&nbsp;</p>
     <p>&nbsp;</p>
     <p align="center">
    
    
    
    
    
   <center>
     <h2><font color="white">Update Product Details</font></h2>

 <%
 String storepath=request.getRealPath("/images");
 int id=Integer.parseInt(request.getParameter("Id"));
 ProductDetailsDao dao=new ProductDetailsDao();
 ProductDetailsForm form=dao.ViewProductDetailsById(storepath,id);
 String countryname=new CountryMasterDao().getCountryName(form.getCountryId());
 %>
  			<form action="updateProductDetailsAction.do" method="register">
  			<table align="center" bgcolor="#666633">
			<tr><td><font color="white"><b>Country Name: </b></font></td>
			<td><select name="countryId">
			 <option value="<%=form.getCountryId() %>"><%=countryname %></option>
			
			<%
			CountryMasterDao dao1=new CountryMasterDao();
			CoreList cl1=dao1.ViewCountryMaster(storepath);
			Enumeration en1=cl1.elements();
			while(en1.hasMoreElements())
			{
			CountryMasterForm form1=(CountryMasterForm)en1.nextElement();
			 %>
			 <option value="<%=form1.getCountryId() %>"><%=form1.getCountryName() %></option>
			 <%} %></select> </td></tr>
		<tr><td><font color="white"><b>Product Name :</b> </td><td><select name="productId">
			<option value="<%=form.getProductId() %>"><%=new ProductMasterDao().getProductName(form.getProductId())%></option>
			
			<%ProductMasterDao dao2=new ProductMasterDao();
			CoreList cl2=dao2.ViewProductMaster();
			Enumeration en2=cl2.elements(); 
			while(en2.hasMoreElements())
			{
			ProductMasterForm form2=(ProductMasterForm)en2.nextElement();
			%>
			<option value="<%=form2.getProductId() %>"><%=form2.getProductName()%></option>
			<%} %></select> </td></tr>
			
			<input type="hidden" name="itemId" value="<%=id %>"/> 
			<tr><td><font color="white"><b>Price :</b></font> </td><td><input type=text name="price" value="<%=form.getPrice() %>"/></td></tr> 
			<tr><td><font color="white"><b>ItemName :</b></font> </td><td><input type=text name="itemName" value="<%=form.getItemName() %>"/> </td></tr>
			<tr><td><font color="white"><b>ItemDesc :</b></font> </td><td><input type=text name="itemDesc" value="<%=form.getItemDesc() %>"/> </td></tr>
		<%String realpath=request.getRealPath("/images"); 
			System.out.println("realpath"+realpath+"/"+form.getItemImage());
			System.out.println("realpath"+realpath+"/"+form.getItemLaunchVideo());
			
			%>
		
			<tr><td><font color="white"><b>Item Launch Video  </b></font></td>
			<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=file name="itemImage"/> </td></tr>
	 <input type="hidden" name="itemImage1" value="<%=realpath+"/"+form.getItemImage() %>"/>
<input type="hidden" name="itemlanuch1" value="<%=realpath+"/"+form.getItemLaunchVideo() %>"/>
	
			<tr><td><font color="white"><b>ItemImage :/b></font> </td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=file name="itemLaunchVideo"/></td></tr> 
			<tr><td><font color="white"><b>ItemRegDate : </b></font></td><td><input type=text name="itemRegDate" value="<%=form.getItemRegDate() %>" readonly/> </td></tr>
			<tr><td></td><td><input type=submit name="Update" value="Update"/> </td></tr></table>
		</form>
	 
     </center>
    
     
     
     </td></tr></table>
          <p>&nbsp;</p>
               <p>&nbsp;</p>
                    <p>&nbsp;</p>
                         
           <p>&nbsp;</p>
               <p>&nbsp;</p>
                    <p>&nbsp;</p>
                         
           <p>&nbsp;</p>
             
                         
                              
     <p>&nbsp;</p></div>


</body></html>